/**
 *
 * @param {检查邮箱是否正确} email
 * @returns
 */
export const utils = {
  checkEmail: function (email) {
    if (email === "") {
      return false;
    }
    let reg = /^\w+@\w+\.\w+$/;
    let flag = reg.test(email);
    if (flag) {
      return true;
    } else {
      return false;
    }
  },
  checkPassword: function (password) {
    if (password === "") {
      return false;
    }
    if (password.length < 6) {
      return false;
    }
    return true;
  },
  checkUsername: function (username) {
    if (username === "") {
      return false;
    }
    if (username.length < 2) {
      return false;
    }
    return true;
  },
};
